require("../../both/base.js")
require("./AdminStudentsCtrl.scss")

import DataTable from "../DataTabel/DataTable.jsx";

class AdminStudentsCtrl extends React.Component{
    constructor(props){
        super(props)

        const init = this.props.init
        init()
    }

    render(){
        var self = this

        const trs = self.props.courses.map((ele,idx) => {
            return <tr key={ele.id.toString()}>
                <td><div className="item">{ele.id}</div></td>
                <td><div className="item">{ele.username}</div></td>
                <td><div className="item">{ele.email}</div></td>
                <td><div className="item"><img className="datatable_img" src={ele.avatar} alt=""/></div></td>
                <td><div className="item">{ele.description}</div></td>
            </tr>
        })

        return <div className="admin_students_ctrl bln">
            <div className="title">
                <span>学生管理</span>
            </div>
            <DataTable {...self.props}
                       ths={["学生id","昵称","邮箱","头像","个性签名"]}
                       searchPlaceHolder="输入文本进行查找"
                       trs={trs}
                       addDisable={true}
                       editDisable={true}
                       selectDisable={true}
                       editHref="#"
            />
        </div>
    }
}

export default AdminStudentsCtrl